From 937f23487a2784df020112d67eff7eb58987bcc3 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 31 Oct 2006 11:31:34 +0000 Subject: [PATCH] [NETFRONT] Make sure we don't crash if the backend goes to state Closing before we have a chance to connect. This can happen if there's an error while connecting. Signed-off-by: Steven Smith --- linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index e03e44a05a..1324345f94 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -522,7 +522,10 @@ static void backend_changed(struct xenbus_device *dev, break; case XenbusStateClosing: - netfront_closing(dev); + if (dev->state == XenbusStateConnected) + netfront_closing(dev); + else + printk(KERN_DEBUG "Netfront: going to state Closing without being connected...\n"); break; } } -- 2.30.2